-- GENERATED SPELL FOR [Twilight Pyromancer] --


function spell0_33820(pUnit, Event) --@Arcane Burst,Self--
pUnit:FullCastSpellOnTarget(64663,pUnit)
pUnit:RegisterEvent('Sorts_33820', 10290, 1)
end

function spell1_33820(pUnit, Event) --@Blink,n/a--
pUnit:FullCastSpellOnTarget(64662,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_33820', 1000, 1)
end

function spell2_33820(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(63789,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_33820', 2000, 1)
end

function spell3_33820(pUnit, Event) --@Flamestrike,n/a--
pUnit:FullCastSpellOnTarget(63775,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_33820', 11000, 1)
end

function spell4_33820(pUnit, Event) --@Summon Fire Elemental,Self--
pUnit:FullCastSpellOnTarget(63774,pUnit)
pUnit:RegisterEvent('Sorts_33820', 582, 1)
end

function Sorts_33820(pUnit, Event)
local choix_sorts_33820 = math.random(0, 4)
if choix_sorts_33820 == 0 then
pUnit:RegisterEvent('spell0_33820', 1, 1)
end
if choix_sorts_33820 == 1 then
pUnit:RegisterEvent('spell1_33820', 1, 1)
end
if choix_sorts_33820 == 2 then
pUnit:RegisterEvent('spell2_33820', 1, 1)
end
if choix_sorts_33820 == 3 then
pUnit:RegisterEvent('spell3_33820', 1, 1)
end
if choix_sorts_33820 == 4 then
pUnit:RegisterEvent('spell4_33820', 1, 1)
end
end

function mob33820_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_33820', math.random(1500, 3000), 1)
end

function mob33820_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob33820_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob33820_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(33820, 1, 'mob33820_Action')
RegisterUnitEvent(33820, 2, 'mob33820_Leave')
RegisterUnitEvent(33820, 3, 'mob33820_Kill')
RegisterUnitEvent(33820, 4, 'mob33820_Die')
